package bb;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 18128
 * Date: 2023-09-24
 * Time: 9:25
 */
class qian implements Cloneable
{
    public int qq=11;

    @Override
    protected Object clone() throws CloneNotSupportedException {
        return super.clone();
    }
}
class per implements Cloneable
{
    public int age;
    public qian qia=new qian();
    @Override
    protected Object clone() throws CloneNotSupportedException {
//        return super.clone();
        per hh=(per)super.clone();
        hh.qia=(qian)this.qia.clone();
        return hh;
    }

}
public class kelong {
    public static void main(String[] args)throws CloneNotSupportedException
    {
        per p1=new per();
        p1.age=10;
        per p2=(per)p1.clone();
        p2.age=90;
        p2.qia.qq=9999;
        System.out.println(p1.age);
        System.out.println(p1.qia.qq);
        System.out.println(p2.age);
        System.out.println(p2.qia.qq);


    }
}
